/* $Id: redir.h 15 2006-12-15 23:14:45Z judas $ */

#ifndef NIH_REDIR_H
#define NIH_REDIR_H 1

#include <nih/cdefs.h>

BEGIN_C_DECLS

extern int nih_redir_filter(int write_fd, const char *command, int read_fd);

extern inline int nih_redir_from(const char *command, int read_fd)
{
        return nih_redir_filter(-1, command, read_fd);
}

extern inline int nih_redir_to(int write_fd, const char *command)
{
        return nih_redir_filter(write_fd, command, -1);
}

END_C_DECLS

#endif /* NIH_REDIR_H */

